<template>
	<view class="policy">
		<u-navbar :border-bottom="false" title-size="35" :title="title1"></u-navbar>
		<rich-text :nodes="textDa"></rich-text>
	</view>
</template>

<script>
	import {
		text,
	} from '@/network/loginAndMy.js'
	export default {
		data() {
			return {
				textDa: '',
				// 1平台协议，2隐私协议，3服务协议，4提现协议
				type: '',
				title1: ""
			}
		},
		onLoad(options) {
			this.type = options.type
			this.textRe()
		},
		methods: {
			// 获取协议数据
			textRe() {
				text().then(res => {
					if (res.code == 1) {
						if (this.type == 1) {
							this.title1 = '平台协议'
							this.textDa = res.data.steamText
						} else if (this.type == 2) {
							this.title1 = '隐私协议'
							this.textDa = res.data.privacyText
						} else if (this.type == 3) {
							this.title1 = '服务协议'
							this.textDa = res.data.serviceText
						} else if (this.type == 4) {
							this.title1 = '提现协议'
							this.textDa = res.data.cashText
						}
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	span {
		text-wrap: wrap !important;
	}

	.policy {
		background-color: #f3f3f3;
	}
</style>